import request from '@/utils/request'

const userApi = {
  Login: '/LoginController/login',
  Logout: '',
  UserInfo: '/LoginController/info',
  generateKey:'/LoginController/generateKey',
  refreshToken:'/LoginController/refreshToken'
  
}

/**

 * @param parameter
 * @returns {*}
 */
export function login (parameter) {
  return request({
    url: userApi.Login,
    method: 'post',
    data: parameter
  })
}

export function generateKey () {
    return request({
      url: userApi.generateKey,
      method: 'get',
    })
  }

  export function refreshToken (parameter) {
    return request({
      url: userApi.refreshToken,
      method: 'post',
      data: parameter
    })
  }

export function getInfo () {
  return request({
    url: userApi.UserInfo,
    method: 'get',
  })
}



export function logout () {
  return request({
    url: userApi.Logout,
    method: 'post',
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

